/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dings
 * Date: 2024-06-01
 * Time: 8:24
 */

/**
 * 包装类 ---装箱、拆箱
 */
public class Test {
    public static void main(String[] args) {

        //缓存数组 -128~127
        Integer a = 100;
        Integer b = 100;
        System.out.println(a == b);
        System.out.println(a.equals(b));
        System.out.println("=============");
        Integer c = 200;
        Integer d = 200;
        System.out.println(c == d);
        System.out.println(c.equals(d));
    }
    public static void main2(String[] args) {
        Integer a = 10;//自动装箱
        int b = a.intValue();//显示拆箱
        int c = a;//自动拆箱
        double d = a.doubleValue();//显示拆箱
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);
        System.out.println(d);
    }
    public static void main1(String[] args) {
        int a = 10;
        Integer b = Integer.valueOf(a);//显示装箱
        Integer c =1;//自动装箱
        Double d = Double.valueOf(a);
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);
        System.out.println(d);
    }
}
